<div id="content"  style="background-color:#ffffff">
  <div id="content-header">
    <div id="breadcrumb"> <a href="?m=admin&t=main" title="Go to Home" class="tip-bottom"><i class="icon-home"></i> 后台首页</a> <a href="#">渠道方管理</a> <a href="#" class="current">新增渠道</a> </div>
  </div>
  <div class="container-fluid"  style=' margin-top:20px'>
   <fieldset class="layui-elem-field">
			<legend>渠道信息</legend>
          <div class="layui-field-box">
            <form id="form-wizard" class="layui-form " method="post" action="?m=admin&o=app&t=savechannel&id=<{$gvar.fget.id}>">
                <div class="layui-form-item">
                  <label class="layui-form-label">渠道名称</label>
                  <div class="layui-input-block">                 
                    <input class="layui-input" id="username" type="text" name="username" value="<{$data.channel_name}>"/><br />
                  </div>
                </div>              
				<div class="layui-form-item">
                  <label class="layui-form-label">公司名称</label>
                  <div class="layui-input-block">
                    <input class="layui-input"  id="company" type="text" name="company"  value="<{$data.company}>"/>
                  </div>
                </div>
				<div class="layui-form-item">
                  <label class="layui-form-label">联系人姓名</label>
                  <div class="layui-input-block">
                    <input  class="layui-input" id="contact_name" type="text" name="contact_name"  value="<{$data.contact_name}>"/>
                  </div>
                </div>
				<div class="layui-form-item">
                  <label class="layui-form-label">联系人电话</label>
                  <div class="layui-input-block">
                    <input  class="layui-input"  id="contact_phone" type="text" name="contact_phone"  value="<{$data.contact_phone}>"/>
                  </div>
                </div>
				<div id="form-wizard-2" class="step">
				<input type="hidden" value="<{$data.id}>" name='id'>
                <div class="layui-form-item">
                  <label class="layui-form-label">状态</label>
                  <div class="layui-input-block">
					<input title='启用' name="status" type="radio" value="1" <{if $data.status==1 || !$data.status}>checked="checked"<{/if}>/>
                    <input title='禁用' name="status" type="radio" value="2" <{if $data.status==2}>checked="checked"<{/if}>/>                 
                  </div>
                </div>
              </div>
			  <div class="layui-form-item">
				<div class="layui-input-block">
				  <input id="next" class="btn btn-primary" type="submit" value="保存" />
				  <!--<button type="reset" class="layui-btn layui-btn-primary">重置</button>-->
				</div>
			   </div> 
            </form>
          </div>
		   </fieldset>
  </div>
</div>
<script>
$(function(){
	
	$("#resources").change(function(){
		
		$("#url").val($(this).find('option:selected').attr('url'));
	})	
	$("#create_key").click(function(){
		
		$("#key").val(getUuid())
	})
	
	function getUuid(){
	  var len=32;//32长度
	  var radix=16;//16进制
	  var chars='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');var uuid=[],i;radix=radix||chars.length;if(len){for(i=0;i<len;i++)uuid[i]=chars[0|Math.random()*radix];}else{var r;uuid[8]=uuid[13]=uuid[18]=uuid[23]='-';uuid[14]='4';for(i=0;i<36;i++){if(!uuid[i]){r=0|Math.random()*16;uuid[i]=chars[(i==19)?(r&0x3)|0x8:r];}}}
	  return uuid.join('');
	}  

})

layui.use(['form', 'layedit', 'laydate'], function(){
  var form = layui.form()
  ,layer = layui.layer
  //,layedit = layui.layedit
  //,laydate = layui.laydate;
  
  //创建一个编辑器
  //var editIndex = layedit.build('LAY_demo_editor');
 
  //自定义验证规则
 
  
  
});
</script>




